<template>

  <div class="container">
    <mt-header fixed title="行程管理">
      <router-link :to="{name:'index'}" slot="left">
        <mt-button icon="back">返回</mt-button>
      </router-link>
    </mt-header>


    <div class="t_title">
      <p>我发布的行程</p>
    </div>

    <div class="profile" v-for ="item in touristList" v-if="touristList.length >0">
      <router-link class="mint-cell" :key="item.id" :to="{name: 'touristDetailAdmin', params:{touristId:item.id}}" >
        <div class="mint-cell-wrapper">
          <div class="mint-cell-title">
              <span class="fa-stack fa-sm" style="color: #FA6E4E">
                <i class="fa fa-calendar-check-o fa-stack-2x"></i>
              </span>
            <span class="mint-cell-title-text">{{item.projectName}}</span>
          </div>
          <a class="mint-cell-allow-right"></a>
        </div>
      </router-link>
    </div>

    <!--div class="add-schedule-wrapper">
      <router-link :to="{name: 'projectAdd'}">
        <i class="fa fa-calendar-plus-o fa-lg"></i>
      </router-link>
    </div-->
    <div class="tourist_add">
      <router-link :to="{name: 'touristEdit'}">
      <a class="weui-btn">马上去发布</a>
      </router-link>
    </div>
  </div>
</template>
<script>
  import fetch from '../../utils/fetch';
  import store from '../../store';
  export default{
    data () {
      return{
        pageReq:{
          count:'',
          page:''
        },
        touristList:[]
      }
    },
    components:{
    },
    created () {
      if (store.getters.sid) {
        console.log('session get');
      }else{
        this.$router.replace({path: '/login'})
      }
      this.handleGetProjects();
    },
    methods:{
      handleGetProjects(){
        this.pageReq.count = 999;
        this.pageReq.page = 0;
        let formData = JSON.stringify(this.pageReq)

        fetch.post('/api/project/list',formData).then(response =>{
          if(response.data.success){
            this.touristList = response.data.response
          }
        })
      }
    },
    deactivated () {
      this.$destroy()
    }
  }
</script>
<style scoped lang="scss">
  @import '../../../static/css/weui.css';
  @import '../../base/css/_base';
  a:link{text-decoration:none;}
  a:visited{text-decoration:none;}
  a:hover{text-decoration:none;}
  a:active{text-decoration:none;}
  .mint-navbar{
    margin: 0 0 20px;
  }

  .container{
    padding-bottom: 1.11rem;
    background: #FFFFFF;
    height: inherit;
    .mint-header{
        font-size: 16px;
        height: 45px;
        line-height: 45px;
        background-color: #f2f2f2!important;
        box-sizing: border-box;
        color: #101010;
    }
    .user-detail {
      position: relative;
      height: 5.0rem;
      width: 100%;
      background: #26A2FF;
      color: #fff;
      @include flex-center;
      .user-detail__img{
        width:1.7625rem;
        height: 1.7625rem;
        margin:0 0.525rem;

        img{
          width: 100%;
          height: auto;
          border-radius:50%;
        }
      }
      .user-detail__message{
        flex:1;
        p{
          padding:0.2rem 0;
          @include fz(9px);
          color: #101010;
          text-align:center;
        }
      }
    }
    .t_title{
       height: 30px;
       line-height: 30px;
       padding: 2px 0 2px 0;
       background-color: #f2f2f2;
       margin-top: 48px;
    }
    .t_title p{
      padding-left: 18px;
      color: #101010;
    }
    .profile{
      padding: 5px 18px;
      .mint-cell
      {
          min-height:40px;
          background-image: none;
         .mint-cell-wrapper,.mint-cell:last-child{
           background-size:0;
         }
      }
        .mint-cell-wrapper{
            border: 1px solid #F15F5C;
            width: 100%;
            .mint-cell-title{
              .mint-cell-title-text{
                white-space: nowrap;
                width: 81%;
                display: inline-block;
                overflow: hidden;
                text-overflow: ellipsis;
                height: 2em;
                position: absolute;
                line-height: 2em;
              }
            }
            .mint-cell-allow-right::after{
                border-color:#F15F5C;
                right: 5%;
            }
            .mint-button{
              display: inline-block;
              position: absolute;
              right: 0;
              border: 1px solid #F15F5C;
              height: 40px;
              z-index: 2000;
              line-height: 40px;
              width: 40px;
              text-align: center;
              font-size: 29px;
              margin-left: 4%;
            }
        }
    }
   .add-schedule-wrapper{
      position: fixed;
      top: 16%;
      right: 10px;
      background: #26a2ff;
      height: 50px;
      width:50px;
      border-radius: 50%;
      z-index: 999;
      opacity:0.5;
      padding: 0 7% 0 10px;
      @include flex-center;
      a{
        color: #fff;
        padding: 5px;
      }
    }
    .tourist_add{
      width: 100%;
      position: fixed;
      bottom: 63px;
      z-index: 1001;
     .weui-btn{
        background-color: #F15F5C;
        border-radius: 0;
        height: 50px;
        line-height: 50px;
        font-size: 16px;
        clear: both;
     }
    }

  }

</style>
